$OpenBSD: patch-Makefile,v 1.13 2017/05/05 14:02:51 sthen Exp $

Index: Makefile
--- Makefile.orig
+++ Makefile
@@ -300,7 +300,7 @@ generate: $(JAVASCRIPT_GEN)
 
 # --- Library ---
 
-MUPDF_LIB = $(OUT)/libmupdf.a
+MUPDF_LIB = $(OUT)/libmupdf.so.${LIBmupdf_VERSION}
 THIRD_LIB = $(OUT)/libmupdfthird.a
 THREAD_LIB = $(OUT)/libmuthreads.a
 
@@ -308,11 +308,12 @@ MUPDF_OBJ := $(FITZ_OBJ) $(FONT_OBJ) $(PDF_OBJ) $(XPS_
 THIRD_OBJ := $(FREETYPE_OBJ) $(HARFBUZZ_OBJ) $(JBIG2DEC_OBJ) $(LIBJPEG_OBJ) $(JPEGXR_OBJ) $(LURATECH_OBJ) $(MUJS_OBJ) $(OPENJPEG_OBJ) $(ZLIB_OBJ)
 THREAD_OBJ := $(THREAD_OBJ)
 
-$(MUPDF_LIB) : $(MUPDF_OBJ)
+$(MUPDF_LIB) : $(MUPDF_OBJ) $(THIRD_LIB) $(THREAD_LIB)
+	$(LINK_CMD) -shared -Wl,-soname -Wl,libmupdf.so.${LIBmupdf_VERSION}
 $(THIRD_LIB) : $(THIRD_OBJ)
 $(THREAD_LIB) : $(THREAD_OBJ)
 
-INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB)
+INSTALL_LIBS := $(MUPDF_LIB)
 
 # --- Tools and Apps ---
 
@@ -321,7 +322,7 @@ MUTOOL_SRC := source/tools/mutool.c source/tools/mucon
 MUTOOL_SRC += $(wildcard source/tools/pdf*.c)
 MUTOOL_OBJ := $(MUTOOL_SRC:%.c=$(OUT)/%.o)
 $(MUTOOL_OBJ) : $(FITZ_HDR) $(PDF_HDR)
-$(MUTOOL_EXE) : $(MUTOOL_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(THREAD_LIB)
+$(MUTOOL_EXE) : $(MUTOOL_OBJ) ${MUPDF_LIB} $(THIRD_LIB) $(THREAD_LIB)
 	$(LINK_CMD) $(PTHREAD_LIBS)
 
 MURASTER_EXE := $(OUT)/muraster
